package com.itboye.core.broadcastreceiver;

import android.annotation.SuppressLint;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.itboye.core.cache.SharedPreferenceCache;

/**
 */
@SuppressLint("NewApi")
public class ByBroadCast extends BroadcastReceiver {

	private boolean isConnect;
	boolean temp;
	SharedPreferenceCache shareCache;
	@Override
	public void onReceive(Context context, Intent intent) {

		isConnect = intent.getBooleanExtra("isConnect", false);
		if (temp == isConnect) {
			if(shareCache==null)
			{
				shareCache=new SharedPreferenceCache();
			}
			else{
			shareCache.set("WIFI_STATE", isConnect, 2);//全局缓存网络状态
			}
		}
		temp = isConnect;
		System.out.println(">>>>>>>>状态"+temp);
	}

	
}
